package com.bjc.controller;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @program: servlet
 * @description:
 * @author: bjc
 * @create: 2021-08-20 21:57
 */
public class OneServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ServletContext context = req.getServletContext();
        //增加数据
        context.setAttribute("key1",100);
        //修改数据
        context.setAttribute("key1",200);
        //删除数据
        context.removeAttribute("key1");
    }
}
